//这里是存放element-ui样式的
import Vue from 'vue'
import {Button, 
    Input,
    Card,
    Table,
    TableColumn,
    FormItem,
    Form,
    Container,
    Header,
    Main,
    Footer,
    Aside,
    Menu,
    MenuItem,
    MenuItemGroup,
    Submenu,
    Breadcrumb,
    BreadcrumbItem,
    Dropdown,
    DropdownItem,
    DropdownMenu,
    Message,
    Divider,
    Tag,
    Radio,
    RadioGroup,
    Select,
    Option,
    MessageBox,
    Tree,
    Upload,
    Dialog,
    Pagination,
    Switch,
    Tabs,
    TabPane,
} from 'element-ui'

Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Switch)
Vue.use(Pagination)
Vue.use(Upload)
Vue.use(Dialog)
Vue.use(Tree)
Vue.use(Option)
Vue.use(Select)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Tag)
Vue.use(Divider)
Vue.use(Button)
Vue.use(Input)
Vue.use(Card)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(FormItem)
Vue.use(Form)
Vue.use(Container)
Vue.use(Main)
Vue.use(Header)
Vue.use(Footer)
Vue.use(Aside)
Vue.use(Menu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Submenu)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Dropdown)
Vue.use(DropdownItem)
Vue.use(DropdownMenu)

// 为了不使它直接调用而采用的办法  成功
Vue.prototype.$success=function(message){
    Message({
        type:'success',
        message
    })
}

Vue.prototype.$error=function(message){
    Message({
        type:'error',
        message
    })
}
// 删除确认提示框
// Vue.prototype.$confirm=MessageBox.confirm
// 优化方法
Vue.prototype.$confirm=function(callback){
    MessageBox.confirm('真删啊?', '提示', {
        confirmButtonText: '真的',
        cancelButtonText: '算了',
        type: 'warning'
      }).then(() => {
        // this.$message({
        //   type: 'success',
        //   message: '删除成功!'
        // });
        callback&&callback()
      }).catch(() => {

      });
}